package stud.aistar.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import stud.aistar.entity.User;
import stud.aistar.mapper.UserMapper;
import stud.aistar.service.IUserService;

import java.util.List;

/**
 * @author wangyu
 * @version 1.0
 * @description
 * @createDate 2019/9/27 15:25
 */
@Service
@Transactional
public class UserServiceImpl implements IUserService{

    @Autowired
    private UserMapper userMapper;


    @Override
    public List<User> findAll() {
        return userMapper.findAll();
    }

    @Override
    public User findByUsername(String username) {
        return userMapper.findByUsername(username);
    }

    @Override
    public void save(User user) {
        userMapper.save(user);
    }

    @Override
    public User findByPhone(String phone) {
        return userMapper.findByPhone(phone);
    }

    @Override
    public void updPwd(Integer phoneId, User user) {
        userMapper.updPwd(phoneId,user);
    }
}
